RHQ_VERSION="4.7.0" # use the current version here cd modules/common/ant-bundle mvn package
We have our own command-line launcher for running RHQ bundle scripts, which has the following differences from the standard Ant 1.8.0 launcher:
main-class is org.rhq.bundle.ant.AntMain, rather than org.apache.tools.ant.Main
launcher scripts are named rhq-ant/rhq-ant.cmd, rather than ant/ant.cmd and have the following mods:
use RHQ_ANT_HOME, rather than ANT_HOME
source /etc/rhq-ant.conf and ~/.rhq/rhq-ant.conf, rather than /etc/ant.conf and ~/.rhq/ant.conf
SourceForge AntContrib tasks and Liquibase tasks are included in $RHQ_ANT_HOME/lib/
build file name and location are not configurable (i.e. no -f option) - build file is always rhq-bundle.xml in the current working dir
The launcher lives in the modules/common/ant-bundle module, which also contains the launcher used by the Server and Agent to parse and execute bundle scripts. To build the launcher:
RHQ_VERSION="4.7.0" # use the current version here cd modules/common/ant-bundle mvn package
This will produce target/rhq-ant-bundle-common-$RHQ_VERSION-SNAPSHOT.zip.
To try out the launcher, first unzip the launcher zipfile:
cd target unzip rhq-ant-bundle-common-$RHQ_VERSION-SNAPSHOT.zip
Then build the sample bundle:
cd etc/samples/sample-bundle mvn install
Then, (as root), execute the sample bundle's recipe as follows:
su - RHQ="~ips/Projects/rhq" cd $RHQ/etc//samples/provisioning/sample-bundle/target/bundle PATH="$RHQ/modules/common/ant-bundle/target/rhq-bundle-deployer-$RHQ_VERSION-SNAPSHOT/bin:$PATH" rhq-ant -Drhq.deploy.id=0 -Drhq.deploy.dir=/tmp/jbossas-petstore -Djboss.bind.address=0.0.0.0 \ -Dhttp.port=7080 -Dhttps.port=7443 -debug
NOTE: root is required because the bundle recipe installs an init script under /etc/init.d/.
This should deploy the sample bundle to /tmp/jbossas-petstore/ and start up the JBoss AS instance running the Java Petstore app. Go to http://localhost:8080/petstore/ in a browser to access the app.
I still need to add a liquibase task to the bundle script to create the Petstore DB (ips, 04/30/10).